package it.thalaz.dataaccess.sqlMap;

import java.io.FileInputStream;
import java.io.InputStream;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class ThalazSqlConfig { 
	private static final SqlMapClient sqlMap;
	static {
		try {
			String resource = "/var/www/siti/framework/webapp/WEB-INF/config/ibatisConfig.xml";
			InputStream reader = new FileInputStream(resource);
			sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(""+ e);
		}
	}
	public static SqlMapClient  getSqlMapInstance() {
		return sqlMap;
	}

}
